﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.Platform.Contract;
using MaxLeaf.Platform.BLLImplementation;
using CommonsLib.Utility;
using MaxLeaf.Platform.DataContract;
using CommonsLib.Settings;
using MaxLeaf.Platform.Functions;

namespace MaxLeaf.Platform.BLLProxy
{

    /// <summary>
    /// 领用出库 相关操作
    /// </summary>
    public class imStoresReqProcessorProxy : BaseBLLProxy, IStoresReqProcess
    {

        IStoresReqProcess _bll;
        private  IStoresReqProcess BLL
        {
            get
            {                
                return _bll;
            }
        }
        public imStoresReqProcessorProxy():base()
        {
            switch ( Access_Mode )
            {

                case MaxLeaf.Platform.Commons.Const.ACCESS_Direct:
                    {
                        _bll = new imStoresReqProcessor();
                        break;
                    }

                case MaxLeaf.Platform.Commons.Const.ACCESS_IIS:
                    {
                        _bll = new imStoresReqProcessorWCFClient(this.WCF_Configs);
                        break;
                    }


                default:
                    {
                        throw new MaxLeaf.Platform.Commons.MaxLeafException(MaxLeaf.Platform.Commons.Const.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);

                    }
            }
        }
       

        

        /// <summary>
        ///  获得部门 已使用量或余额
        /// </summary>
        /// <param name="intDepID">部门id</param>
        /// <param name="intType">0:月使用量, 1:月余额</param>
        /// <returns>已使用量或余额</returns>
        public double GetDepAmt(int intDepID, int intType)
        {
            return BLL.GetDepAmt(intDepID, intType);
        }

        /// <summary>
        /// 获得公司 已使用量或余额
        /// </summary>
        /// <param name="intCompanyID">公司id</param>
        /// <param name="intType">0:月使用量, 1:月余额</param>
        /// <returns>已使用量或余额</returns>
        public double GetCompanyAmt(int intCompanyID, int intType)
        {
            return BLL.GetCompanyAmt(intCompanyID, intType);
        }
    }
}
